package com.example.leo.mycharmingstudent.a0917.practice;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.leo.mycharmingstudent.R;

public class MainPageActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_page);

        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        /*
        开启事务时候就可以进行
        add，remove，replace，show，hide等操作
         */
        transaction.add(R.id.fl_container_activity_main_page,
                /*创建一个Fragment*/
                new MainPageFragment());
        transaction.commit();

    }
}
